import random
from collections import Counter
random_numbers= []
for _ in range(100):
    random_number = random.randint(0, 9)
    random_numbers.append(random_number)

average = sum(random_numbers) / len(random_numbers)
number_counts = Counter(random_numbers).most_common()

print("平均值：", average)
print("数字出现次数：")
for number, count in number_counts:
    print(number, "出现了", count, "次")